#!/usr/bin/python
"""Starts Pyro4 nameserver.

Configuring the server type as "multiplex" is essential to the database server,
because pytables supports only one connection to the database.

"""
if __name__ == "__main__":
    import Pyro4
    from misc import misc

    Pyro4.config.SERVERTYPE = "thread" # Can't have multiplex, will protect myself with locks instead
#    Pyro4.config.SERVERTYPE = "multiplex"
    Pyro4.config.SOCK_REUSE = True

    print "Starting *Pyro4* nameserver..."
    hostname = misc.AskUser()
    nsport = 9093

    Pyro4.naming.startNSloop(host=hostname, port=nsport)


